package com.itheima.zy;

public class Test18 {
    public static void main(String[] args) {
        int[] q = {12, 35, 57, 89, 75, 39, 66};
        for (int i = 0, h = q.length - 1; i < h; i++, h--) {
            int a = q[i];
            q[i] = q[h];
            q[h] = a;

        }
        int temp = 0;
        int max = q[0];
        int min = q[0];
        for (int i = 0; i < q.length; i++) {
            System.out.println(q[i]);
            temp += q[i];
            if (q[i] > max) {
                max = q[i];
            } else if (q[i] < min) {
                min = q[i];
            }
        }
        System.out.println("--------------------------");
        System.out.println("总和值：" + temp);
        System.out.println("最大值：" + max);
        System.out.println("最小值：" + min);
        System.out.println("平均值：" + temp / q.length);
    }
}
